package com.example.alee.ALeeSpringWeb;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

import java.util.Date;

/**
 * @SpringBootConfiguration --》Configuration 配置类结合@Bean 可以将对象注入Spring的IOC容器
 * @EnableAutoConfiguration 开启自动配置
 * --》把spring和第三方库的对象注入Spring容器中
 * @ComponentScan 组件扫描器
 * --》 扫描 @Controller、@Service、@Repository、@Component 注解
 * 启动类Application 放到根包目录下，可扫描根包和子类包中的所有类
 */

//@EnableConfigurationProperties(value = {NestAppBean.class})
@ConfigurationPropertiesScan(basePackages = {"com.example.alee.ALeeSpringWeb.bean", "com.example.alee.ALeeSpringWeb.config"})
@SpringBootApplication()
public class ALeeSpringWebApplication {


    @Bean
    public Date iniDATE() {
        return new Date();
    }

    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(ALeeSpringWebApplication.class, args);
    }


}
